import Mock from 'mockjs'

Mock.mock('/api/performances', 'get', {
    'code': 200,
    'message': 'success',
    'data': {
        'list|10': [{
            'id|+1': 1,
            'employeeId': /EMP[0-9]{3}/,
            'name': '@cname',
            'department': '@pick(["技术部","市场部","人力资源部","财务部","产品部","客服部"])',
            'position': '@pick(["前端工程师","后端工程师","产品经理","UI设计师","测试工程师","项目经理"])',
            'evaluationPeriod': '@pick(["2023-Q1","2023-Q2","2023-Q3","2023-Q4"])',
            'overallScore|60-100': 1,
            'status|1-2': 1,
            'evaluator': '@cname',
            'evaluationDate': '@date("yyyy-MM-dd")'
        }],
        'total': 100
    }
})

// 其他绩效相关的 Mock 接口
Mock.mock(/\/api\/performances\/\d+/, 'get', {
    'code': 200,
    'message': 'success',
    'data': {
        'id': 1,
        'employeeId': 'EMP001',
        'name': '@cname',
        'department': '@pick(["技术部","市场部"])',
        'position': '前端工程师',
        'evaluationPeriod': '2023-Q1',
        'overallScore': 85,
        'status': 1,
        'evaluator': '@cname',
        'evaluationDate': '@date("yyyy-MM-dd")',
        'qualityScore': 4,
        'qualityComment': '代码质量高，bug率低',
        'efficiencyScore': 5,
        'efficiencyComment': '开发效率很高',
        'teamworkScore': 4,
        'teamworkComment': '团队协作良好',
        'overallComment': '表现优秀，继续保持'
    }
})